gtkcssnumbervalue.c: Include fallback-c89.c to fix build
authorChun-wei Fan <fanchunwei@src.gnome.org>
Wed, 23 Dec 2015 10:58:42 +0000 (18:58 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Wed, 23 Dec 2015 11:23:17 +0000 (19:23 +0800)
... on older Visual Studio versions, where isinf() is not available, and
copy the isinf() implementation from gdk/fallback-c89.c to
gtk/fallback-c89.c.

gtk/fallback-c89.c
gtk/gtkcssnumbervalue.c

index aaccd9d0ce12859268d2839d51712965ad45af02..e87bf76c0c5395729349b856dd10a0a4bb5d8c54 100644 (file)
@@ -65,3 +65,15 @@ nearbyint (double x)
   return floor (x + 0.5);
 }
 #endif
+
+#ifndef HAVE_DECL_ISINF
+/* Unfortunately MSVC does not have finite()
+ * but it does have _finite() which is the same
+ * as finite() except when x is a NaN
+ */
+static inline gboolean
+isinf (double x)
+{
+  return (!_finite (x) && !_isnan (x));
+}
+#endif
index 5db0758535d718e23a1040cacdb0858b8a4cf25a..49bd67cd7e86399232fb5e86c6544bb337b6d9e3 100644 (file)
 
 #include "config.h"
 
-#include <math.h>
-
 #include "gtkcssnumbervalueprivate.h"
 
 #include "gtkcssenumvalueprivate.h"
 #include "gtkcssinitialvalueprivate.h"
 #include "gtkstylepropertyprivate.h"
 
+#include "fallback-c89.c"
+
 struct _GtkCssValue {
   GTK_CSS_VALUE_BASE
   GtkCssUnit unit;